package com.alks.function.controller.stockdept.pcfactorystockquery;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.RoleCheck;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.stockdept.pcfactorystockwork.RtCheckRequest;
import com.alks.function.data.request.stockdept.pcfactorystockwork.RtCheckUpRequest;
import com.alks.function.data.request.stockdept.pcfactorystockwork.RtLotRequest;
import com.alks.function.service.stockdept.pcfactorystockquery.IPcMtlReturnService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@ApiRestController("/pcFactorStockQuery")
@Api(value = "仓储部查询",tags = "仓储部-仓储工厂作业-材料退货作业")
@Slf4j
@RoleCheck(prgIds = {"160103"},methodName = {"getMtlRtBackQuery"})
public class PcMtlReturnController {
    @Autowired
    IPcMtlReturnService returnService;

    @PutMapping("/getMtlRtCheckQuery")
    @ApiOperation(value = "检核资料查询-分页可条件查询",tags = "仓储部-仓储工厂作业-材料退货作业")
    public ResponseInfo getMtlRtCheckQuery(@RequestBody RtCheckRequest request){
        return returnService.getMtlRtCheckQuery(request);
    }

    @PutMapping("/getMtlRtLotQuery")
    @ApiOperation(value = "指令明细查询-条件查询",tags = "仓储部-仓储工厂作业-材料退货作业")
    public ResponseInfo getMtlRtLotQuery(@RequestBody RtLotRequest request){
        return returnService.getMtlRtLotQuery(request);
    }

    @PutMapping("/getMtlRtUnCheckQuery")
    @ApiOperation(value = "未检核查询-分页可条件查询",tags = "仓储部-仓储工厂作业-材料退货作业")
    public ResponseInfo getMtlRtUnCheckQuery(@RequestBody RtCheckRequest request){
        return returnService.getMtlRtUnCheckQuery(request);
    }

    @GetMapping("/getMtlRtBackQuery")
    @ApiOperation(value = "厂商，类型-回显",tags = "仓储部-仓储工厂作业-材料退货作业")
    public ResponseInfo getMtlRtBackQuery(){
        return returnService.getMtlRtBackQuery();
    }

    @PutMapping("/MtlRtCheckUpdate")
    @ApiOperation(value = "退货情况修改-修改",tags = "仓储部-仓储工厂作业-材料退货作业")
    public ResponseInfo MtlRtCheckUpdate(@RequestBody List<RtCheckUpRequest> request){
        return returnService.MtlRtCheckUpdate(request);
    }

    @PutMapping("/MtlRtPcUpdate")
    @ApiOperation(value = "退货批处理-修改",tags = "仓储部-仓储工厂作业-材料退货作业")
    public ResponseInfo MtlRtPcUpdate(@RequestBody List<RtCheckUpRequest> request){
        return returnService.MtlRtPcUpdate(request);
    }
}
